<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <jsp:include page="/resources/inc/pageHead.jsp" />
    <link href="${basePath}/resources/zheng-admin/plugins/zTree_v3/css/demo.css" rel="stylesheet"/>
    <link href="${basePath}/resources/zheng-admin/plugins/zTree_v3/css/metroStyle/metroStyle.css" rel="stylesheet"/>
</head>
<body>
<form class="layui-form layui-form-pane" id="_form">
    <input value="${interviewRecords.id}" name="id" type="hidden">
    <input value="${interviewRecords.resumeId}" name="resumeId" type="hidden">
    <div class="layui-form-item">
        <label class="layui-form-label">面试官</label>
        <div class="layui-input-block ztreeDiv">
            <input type="text" readonly="readonly"
                   placeholder="请选择面试官" class="layui-input" onclick="ZtreeCommon.showMenu(this)" id="interviewer"
                   ztreeId="interviewerZtree">
            <input type="hidden" name="interviewer" ztreeId="interviewerZtree" value="${interviewRecords.interviewer}">
        </div>
        <div class="menuContent" style="display:none; position: absolute;z-index: 10000">
            <ul id="interviewerZtree" class="ztree" style="margin-top:0; width:220px;"></ul>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">面试时间</label>
        <div class="layui-input-block">
            <input type="text" name="ctime" autocomplete="off" placeholder="请选择面试时间"
                   class="layui-input date-select" readonly="readonly"
                   value="<fmt:formatDate value='${interviewRecords.ctime}' pattern='yyyy-MM-dd HH:mm:ss'/>">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">面试内容</label>
        <div class="layui-input-block">
            <textarea name="content" placeholder="请输入面试内容" class="layui-textarea">${interviewRecords.content}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">面试意见</label>
        <div class="layui-input-block">
            <textarea name="interviewOption" placeholder="请输入面试意见"
                      class="layui-textarea">${interviewRecords.interviewOption}</textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="sub">立即提交</button>
        </div>
    </div>
</form>
<jsp:include page="/resources/inc/pageFooter.jsp" />
<script src="${basePath}/resources/zheng-admin/js/my-ztree-common.js"></script>
<script>
    var nodes = getOrganizationTree(false, true);
    var interviewers = [${interviewRecords.interviewer}];
    $(function () {
        FormCommon.initForm({
            url: '${basePath}/oa/hr/resume/updateInterviewRecords',
            subContentType: "json",
            editData: function (data) {
                data.ctime = new Date(data.ctime).getTime();
                return data;
            }
        });
        var tree = $.fn.zTree.init($("#interviewerZtree"), ZtreeCommon.checkBoxSetting, nodes);
        layui.use('laydate', function () {
            laydate = layui.laydate;
            $(".date-select").each(function (index, input) {
                laydate.render({
                    elem: this //指定元素
                    , theme: '#393D49'
                    , type: 'datetime'
                });
            });
        });
        var names = "";
        $(interviewers).each(function (index, interviewer) {
            var node = tree.getNodeByParam("nodeId", "userId" + interviewer, null);
            if (index > 1) {
                names += "," + node.name;
            } else {
                names += node.name;
            }
            tree.checkNode(node, true, true);
        });
        $("#interviewer").val(names);

    });


</script>
</body>
</html>
